<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>帮助中心</title>
<link rel="stylesheet" type="text/css" href="../img/base.css">
<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../js/jquery-1.8.2.min.js"></script>
<script language="javascript">
	function selectAll(){
		var tof = $('#all_number').attr('checked');
		if(tof) $("input[name='number[]']:checkbox").attr('checked','checked');
		else $("input[name='number[]']:checkbox").attr('checked','');
	}
	
	function submit_check()
	{
		var number_arr = $("input[name='number[]']:checked");
		if(number_arr.length > 0){
			return true;
		}else{
			alert('请选择要操作的文档');
			return false;	
		}
	}
	function update_check()
	{	
		var result = true;
		$('#number_op').val('update_check');
		result = submit_check();
		return result
	}
	function update_uncheck()
	{	
		var result = true;
		$('#number_op').val('update_uncheck');
		result = submit_check();
		return result;
	}
	function del()
	{	
		var result = true;
		result = submit_check();
		if(result)
		{
			if(!confirm('确定要删除文档?'))
			{
				result = false;
			}
		}
		$('#number_op').val('del_help');
		return result;
	}
</script>
</head>
<body leftmargin="8" topmargin="8" background='../img/allbg.gif'>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td align='center' valign='top'>
		    <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA">
            	<tr>
                	<td height="28" background="../img/tbg.gif">
                    	<div style="float:right;padding-right:6px;">
                            <a href='help_info.php?op=add_help_dis' class='np coolbg'>添加文档</a> &nbsp;&nbsp;
							<a href='help_type.php?op=type_display' class='np coolbg'>管理类目</a>&nbsp;&nbsp;
                            
                        </div>
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
                
            <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA">
				<tr>
    				<td height="26" background="../img/tbg.gif">
                    <form action="help_list.php" method="post">
    					<table width="98%" border="0" cellspacing="2" cellpadding="2">
     						<tr>
                            	<td width="80" >标题：</td>
                    			<td><input type='text' name='title' id="title" value="<{$title}>" style="width:250px;"  /></td>
								<td width="80">日期：</td>
                    			<td>
									<input type='text' name='starttime' id="starttime" value="<{$starttime}>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'endtime\')}'})" />&nbsp;-&nbsp;
									<input type='text' name='endtime' id="endtime" value="<{$endtime}>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'starttime\')}'})" />
								</td>
     						</tr>
							<tr>
								<td width="80">权限：</td>
                    			<td>
									<select name="status">
										<option value="-1">请选择</option>
										<option value="1" <{if $status == 1}>selected="selected"<{/if}> >开放浏览</option>
										<option value="0" <{if $status == 0}>selected="selected"<{/if}> >待审核</option>
									</select>
								</td>
								<td>类目；</td>
								<td>
									<select name="type_id">
										<option value="-1">请选择</option>
										<{foreach from=$type_list item=tl}>
										<option value="<{$tl.type_id}>" <{if $type_id == $tl.type_id}>selected="selected"<{/if}> ><{$tl.type_name}></option>
										<{/foreach}>
									</select>
								</td>
							<tr>
								<td colspan="4"></td>
							
							</tr>
							<tr>
								<td colspan="4"></td>
							
							</tr>
							<tr>
								<td colspan="4"></td>
							
							</tr>
                            <tr>
                            	<td colspan="4" align="center">
                                	<input type="hidden" name="op" value="search" />
                                	<input type='submit' class="coolbg np" value=' 搜索 ' />&nbsp;&nbsp;
                                </td>
                            </tr>
    					</table>
                    </form>
    				</td>
    			</tr>
            </table>
            
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
			<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="9" background="../img/tbg.gif">帮助中心</td>
				</tr>
                <tr align="center" bgcolor="#FAFAF1" height="22">
                    <td width="3%"><input type="checkbox" name="all_number" id="all_number" onClick="selectAll()"/></td>
					<td width="5%">ID</td>
					<td width="">文档标题</td>
                    <td width="15%">录入时间</td>
                    <td width="10%">类目</td>
                    <td width="10%">权限</td>
					<td width="10%">发布人</td>
					<td width="10%">操作</td>
                </tr>
				
                <form action="help_act.php" method="post" name="frm" id="frm" ">
				<{foreach from=$help_list item=help}>
                <tr align='center' bgcolor="#FFFFFF"  onMouseMove="javascript:this.bgColor='#f4fbf4';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
					<td><input type="checkbox" name="number[]" value="<{$help.help_id}>"/></td>
					<td>
						<{$help.help_id}>
					</td>
					<td><{$help.title}></td>
					<td><{$help.add_time|date_format:"%Y-%m-%d %T"}></td>
                    <td><{$help.type_name}></td>
                    <td>
					<{if $help.status == 0}>
					待审核
					<{elseif $help.status == 1}>
					开放浏览
					<{else}>
					-
					<{/if}>
					</td>
					<td><{$help.writer}></td>

                    <td>
                        <a style="color:#00F" href="help_info.php?op=edit_help_dis&help_id=<{$help.help_id}>">编辑</a>
                    </td>
                </tr>
                <{/foreach}>
                	
                <tr bgcolor="#FAFAF1">
                	<td height="24" colspan="15">
                    	<input type="hidden" id="number_op" name="op" value="" />
                        <input type='submit' class="coolbg np" value='开放浏览' onClick=" return update_check();" />&nbsp;&nbsp;
                        <input type='submit' class="coolbg np" value='待审核' onClick="return update_uncheck();" />&nbsp;&nbsp;
                        <input type='submit' class="coolbg np" value='删除' onClick="return del();" />&nbsp;&nbsp;
                        <{$page_str}>
                    </td>
                </tr>
				</form>
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                	<td height="4"></td>
                </tr>
                <tr bgcolor="#FFFFFF">
                	<td height="26"></td>
                </tr>
				<tr>
					<td colspan="2" height="4"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>